//新增记账回调处理
function bill_callback(formobj, formret, btnobj, dialogobj) {
    $(".tabs_t ul li[rel='" + $("input[name='row[type]']:checked", dialogobj.dialog).val() + "'] a").click();
    if (!$("input[name='row[continue]']", formobj).attr("checked")) {
        dialogobj.close();
    }
}
//批量添加回调处理
function bill_multi_callback(formobj, formret, btnobj, dialogobj) {
    $(".m_hide").hide();
    $(".m_expense").show();
    $(".validform input,.validform select").attr("ignore", "ignore");
    if (!$("input[name=continue]", formobj).attr("checked")) {
        dialogobj.close();
    }
}
//删除记账记录
function bill_pager_callback(formobj, formret, btnobj, dialogobj) {
    if (formobj && dialogobj && !$("input[name=continue]", formobj).attr("checked")) {
        dialogobj.close();
    }
    if ($(".billpager .current").size() > 0) {
        KS.bill.load($(".billpager .current").text());
    } else {
        $("#billul li.current a").click();
    }
}
//添加账户回调处理
function account_callback(formobj, formret, btnobj, dialogobj) {
    var opt = $("<option value='" + formret.data.id + "'>" + formret.data.name + "</option>");
    $("select[name='row[account_id]']:not([credit]),select[name='row[inaccount_id]']:not([credit])").append(opt);
    if (formret.data.type == 'credit') {
        $("select[name='row[inaccount_id]'][credit]").append(opt);
    }
    if (formret.data.domid != 'undefined' && formret.data.domid != '') {
        $("#" + formret.data.domid).attr("value", formret.data.id).change();
    }
    $("#tabs_l li:last a").click();
    dialogobj.close();
}
function bbs_callback(formobj, formret, btnobj, dialogobj) {
    var sid = $("select[name='category_id']", formobj).val();
    $("a[sid='" + sid + "']").click();
}
function reply_callback(formobj, formret, btnobj, dialogobj) {
    $("#fastreply ins").text(parseInt($("#fastreply ins").text()) + 1);
    $("#get_last_reply").click();
}
function bbs_edit_callback() {
    $("#get_post_url").click();
}
function diary_callback(formobj, formret, btnobj, dialogobj) {
    $("#tabs_l li:first a").click();
    if (!$("input[name=continue]", formobj).attr("checked")) {
        dialogobj.close();
    }
}
function diary_edit_callback() {
    $("#get_post_url").click();
}
function note_callback() {
    $("#tabs_l li:first a").click();
}
function category_callback(formobj, formret, btnobj, dialogobj) {
    $("#tabs_l li:first a").click();
    if (!$("input[name=continue]", formobj).attr("checked")) {
        dialogobj.close();
    }
}
function family_callback(formobj, formret, btnobj, dialogobj) {
    $("#tabs_l li.current a").click();
}

function family_delete(obj) {
    $(obj).parent().parent().remove();
}
function family_edit() {
    $(".tabs_t li.current a").click();
}

function category_delete(obj) {
    var tr = $(obj).closest("tr");
    if (tr.attr("father_id") == "0") {
        $("tr[father_id='" + tr.attr("cid") + "']").remove();
    }
    tr.remove();
}

function account_delete(obj) {
    $(obj).parent().parent().remove();
}
function account_edit() {
    $(".tabs_t li.current a").click();
}

function budget_callback(formobj, formret, btnobj, dialogobj) {
    $(".tabs_t li.current a").click();
}

function task_edit_callback(formobj, formret, btnobj, dialogobj) {
    $(".tabs_t li.current a").click();
}